import prompt from '@system.prompt';
import router from '@system.router';
export default {
    data: {
        title: "",
        index:0,
        token:"",
        qianming:"暂无签名哦",
        colorlist:["#66CDCA","#000000"],
        accounturi:"/common/images1/touxiang.jpg",
        username:"用户名",
        jindudate:60,
        switch_urilist:["/common/images1/switch_action.png","/common/images1/switch.png"],
        switch_uri:"/common/images1/switch.png",
        switch_statu:true,
        switch_text:"未连接",
        gongneng:[
            {gongnengtext:"评估结果",pingguuri:"/common/images1/pinggu.png"},
            {gongnengtext:"历史评估",pingguuri:"/common/images1/lishijilu.png"},
            {gongnengtext:"康复计划",pingguuri:"/common/images1/jihua.png"},
            {gongnengtext:"医师咨询",pingguuri:"/common/images1/zixun.png"}
        ]
    },
    onInit() {
        this.title = "Hello World";
    },
    onShow(){
        router.clear();
    },
    kaishi(){
        router.push({
            uri:'pages/shouye/start_pinggu/start_pinggu'
        })
    },
    yishizixun(){
        router.push({
            uri:'pages/shouye/yishizixun/yishizixun'
        })
    },
    kangfujihua(){
        router.push({
            uri:'pages/shouye/kangfujihua/kangfujihua'
        })
    },
    history(){
        router.push({
            uri:'pages/shouye/history/history'
        })
    },
    pinggujieguo(){
        router.push({
            uri:'pages/shouye/pinggujieguo/pinggujieguo',
            params:this.token
        })
    },
    change(e){
        this.index=e.index;
    },
    switch_connect(){
        this.switch_statu = !this.switch_statu
        if(this.switch_statu){
            this.switch_uri = this.switch_urilist[0];
            this.switch_text = "已连接"
            prompt.showToast({
                message:"已成功连接",
                duration:2000
            })
        }else {
            this.switch_uri = this.switch_urilist[1];
            this.switch_text = "未连接"
            prompt.showToast({
                message:"已成功断开",
                duration:2000
            })
        }
    }
}
